home *** CD-ROM | disk | FTP | other *** search
- # Real/Time Login script for WINSOCK 2.0
- # Configured for 28.8K modem bank
- #
- #-------------------------------------------------------------------------
- display "$Id: login.cmd,v 4.4 1995/12/11 08:54:52 fmouse Exp $"\n\n
- #-------------------------------------------------------------------------
- # To configure flow control for your modem, run setup.cmd
- # to configure your dialing sequence, run dialprfx.cmd
-
- # $bombout is the number of non-busy dial retries through which to cycle
- # before declaring a timeout bombout.
- %bombout = 7
-
- load $rnumb
- load $setup
- load $PPPsetup
- load $dialpre
- load $modemsetup
- load $modsetup2
- $goodport = "Y"
- $sresp = "Y"
- %restart = 0
-
- if ($PPPsetup <> "YES")
- display \nUSERNAME AND PASSWORD:\n\n
- display \nPlease select \"PPP options\" from the Trumpet Winsock\n
- display File menu and enter your username and password.\n\n
- display IMPORTANT: You must prefix your username with an\n
- display uppercase \"P\". For example, if your login ID is\n
- display \"joe\", enter your username as \"Pjoe\".\n\n
- display Please do this now, and then run \"Login\" from\n
- display the Trumpet Winsock Dialler menu.\n\n
- $PPPsetup = "YES"
- save $PPPsetup
- abort
- end
-
- while ($setup <> "YES")
- if [query $dialpre DIALING PREFIX: \(\"*70,\" to disable call waiting\)]
- end
- if [query $goodport SLIP PORT: Set to \(COM\) %slipport. OK? \(Y or N\)]
- end
- $ugp = upper($goodport)
- if pos("N",$ugp) > 0
- %restart = 1
- end
- if [query $sresp Did you answer the questions correctly? \(Y or N\)]
- else
- $sresp = "N"
- end
- $usresp = upper($sresp)
- if pos("Y",$usresp) > 0
- $setup = "YES"
- end
- end
- save $setup
- save $dialpre
-
- if %restart = 1
- display \nSLIP PORT NUMBER:\n\n
- display Select \"Setup\" from the File menu and set the SLIP\n
- display Port entry to correspond to the COM port on your\n
- display computer to which your modem is connected. After\n
- display doing this, close Trumpet Winsock (Alt-F4) and restart\n
- display it. If your setup is correct, Trumpet Winsock should\n
- display dial and connect to Real/Time\'s 28.8K modem bank.\n\n
- abort
- end
-
- #--------Initialize Modem:----------
-
- output "ATZ"\13
- if ![input 5 "OK"]
- display \nABORTING. Your modem is not responding.\n
- display Please check your phone line connection\n
- display and Slip port setting in the File | Setup\n
- display dialog box.\n
- abort
- end
- output AT$modemsetup$modsetup2\13
- if [input 5 "OK"]
- display \nMODEM INITIALIZATION SUCCESSFUL!\n
- else
- display \nABORTING. Modem initialization problem.\n
- display Please run the setup script from the\n
- display Trumpet Winsock Dialler menu.\n
- abort
- end
-
- #--------Dial phone number:---------
- %n = 0
- %nw = 0
- %ok = 0
- %timeout = 0
-
- repeat
- $dialnum = $rnumb
- $result = ""
- sleep 1
- %n = %n +1
- display "DIAL ATTEMPT: "%n
- outputecho "ATDT"$dialpre$dialnum\13
- while (!pos("CONNECT", $result) & !pos("NO DIAL", $result) & !pos("BUSY", $result) & !%timeout)
- %timeout = ![read 60 $result]
- end
- if %timeout
- display \n"TIMEOUT"\n
- if %n <= %bombout
- %ok = 0
- %timeout = 0
- else
- display \nABORTING. Too many timeouts\n
- display Your Slip port setting in the File | Setup\n
- display dialog box may be incorrect. Please re-run\n
- display Login from the Dialler menu.\n
- $setup = "NO"
- save $setup
- abort
- end
- else
- if pos("NO DIAL", $result)
- display Your modem is not connected to your phone line\n
- display or your phone is already off hook. Please\n
- display check your phone line.\n\n
- display Select \"Login\" from the Dialler menu to try again.\n
- abort
- end
- if $result = "BUSY"
- %ok = 0
- else
- if pos("CONNECT",$result) > 0
- %ok = 1
- else
- display \nYour modem failed to connect and reported the\n
- display "following error: "
- display $result
- abort
- end
- end
- end
- until %ok = 1
-
- # Wait for DCD:
- if [wait 30 dcd]
- display \nConnection Established. Starting PPP negotiation.\n
- else
- display \nDCD line change not detected.\n
- display Trumpet can't tell if your modem is connected.\n
- end
- sleep 2
- online
-